﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using blackhouse.Payments.Data;

namespace blackhouse.Payments.Presenter {
    public class PaymentError {

        #region Fields

        private IPaymentsDataAccess dataAccess;

        #endregion

        #region Properties

        public int ErrorCode { get; set; }
        public string ErrorDescription { get; set; }
        public bool Exist { get; set; }

        #endregion

        #region Constructors

        public PaymentError(int errorId) {
            this.dataAccess = PaymentsDataFactory.Instance().GetPaymentDataAccess();
            PaymentErrorData data = this.dataAccess.GetPaymentError(errorId);
            if (data.ErrorId == errorId) {
                this.ErrorCode = data.ErrorId;
                this.ErrorDescription = data.ErrorDescription;
                this.Exist = true;
            }
        }

        #endregion

    }
}
